﻿#pragma once

#include "geom/geom_curve.h"
#include "geom/geom_surface.h"

#include <unordered_set>

namespace CAGD
{

/**
 * 前向声明.
 */
class TopoBody;
class TopoLump;
class TopoShell;
class TopoWire;
class TopoFace;
class TopoLoop;
class TopoCoedge;
class TopoEdge;
class TopoVertex;
class TopoMesh;

/**
 * 拓扑类型.
 */
enum class TopoType
{
    BASE,
    BODY,
    LUMP,
    SHELL,
    FACE,
    WIRE,
    LOOP,
    COEDGE,
    EDGE,
    VERTEX,
    MESH
};

/**
 * 拓扑方向.
 */
enum class TopoDir
{
    FORWARD,  // 与底层几何同向
    BACKWARD, // 与底层几何反向
    BOUNDARY, // 边界环
    INTERIOR  // 内环
};

/**
 * 拓扑基类.
 */
class TopoBase
{
  public:
    /**
     * @brief 基本构造.
     * @see
     */
    TopoBase();

    /**
     * @brief 获得当前变换矩阵.
     * @return
     * @see
     */
    BMat4x4 Trsf() const;

    /**
     * @brief 设置变换矩阵.
     * @param trsf
     * @see
     */
    void SetTrsf(const BMat4x4 &trsf);

    /**
     * @brief 拓扑类型.
     * @return
     * @see
     */
    virtual TopoType Type() const = 0;

  protected:
    BMat4x4 m_trsf;
};

} // namespace CAGD
